package com.tanjun.userservice.web.biz.api;

import com.tanjun.common.utils.ConvertUntil;
import com.tanjun.userservice.apiservice.response.adminmenu.admin.AdminMenuResponse;
import com.tanjun.userservice.web.service.menu.entity.BaseAdminMenuEntity;
import com.tanjun.userservice.web.service.menu.service.BaseAdminMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminMenuApiBiz {
    @Autowired
    private BaseAdminMenuService adminMenuService;
    /**
     * 根据角色id获取对应的菜单
     *
     * @param roleIds 角色ids
     * @return
     */

    public List<AdminMenuResponse> getMenusByRoleIds(List<Long> roleIds) {
        List<BaseAdminMenuEntity> list=adminMenuService.listMenuByRoleIds(roleIds);
        return ConvertUntil.convert(list, AdminMenuResponse.class);
    }
}
